package com.whut.coc.application.service;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

/**
 * @author wangzonghe
 * @date 2025/6/20 16:18
 */
@AiService(
        // 手动装配chatModel
        wiringMode = AiServiceWiringMode.EXPLICIT,
        // 制定装配的model
        chatModel = "openAiChatModel",
        // 装配流式调用model
        streamingChatModel = "openAiStreamingChatModel",
        /*// 配置会话记忆对象
        chatMemory = "chatMemory"*/
        // 配置会话记忆提供者对象
        chatMemoryProvider = "chatMemoryProvider",
        // 配置向量数据库内容检索对象
        contentRetriever = "contentRetriever",
        // 配置tools
        tools = "COCTool"
)
public interface ConsultantService {

    /**
     * 用于聊天的方法
     * @param question 用户的问题
     * @return ai的答案
     */
    @SystemMessage(fromResource = "system.txt")
    public Flux<String> chat(@MemoryId String memoryId, @UserMessage String question);

}
